package com.honour.controller.interfaced;



import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.honour.service.interfaced.SysNoticeInManager;
import com.system.controller.base.BaseController;
import com.system.util.AppUtil;
import com.system.util.PageData;
import com.system.util.Tools;


/**  汇聚主页接口
 @Function
 @Author 于泓磊
 @Date   2017年11月16日
*/
@Controller
@RequestMapping(value="/appsysnoticein")
public class SysNoticeInController extends BaseController{
	
	@Resource(name="sysnoticeService")
	private SysNoticeInManager sysnoticeinService;
	
	/**
	 *获取系统通知列表接口
	 * @Author zhaozhenhua
	 * @date   2017年12月08日
	 * @return
	 */
	@RequestMapping(value="/syonoticelist")
	@ResponseBody
	public Object getConvergeList(){
		logBefore(logger, "获取系统通知列表接口");
		Map<String,Object> map = new HashMap<String,Object>();
		PageData pd = new PageData();
		pd = this.getPageData();
		String result = "00";
		try{
			if(Tools.checkKey("SYSNOTICELIST", pd.getString("FKEY"))){	//检验请求key值是否合法
				List<PageData> list = sysnoticeinService.getSysNoticeList(pd);
					if (list.size()!=0) {
						 map.put("pd", list);
					}
					//返回01为查询成功并返回,02为查询为空
					result = (0 == list.size()) ?  "02" :  "01";
			}else{
				result = "05";
			}
		}catch (Exception e){
			logger.error(e.toString(), e);
		}finally{
			map.put("result", result);
			logAfter(logger);
		}
		return AppUtil.returnObject(new PageData(), map);
	}
	
}
